{% extends "main.html" %}
{% block  title %} Actress {% endblock %}
{% block name %}Actress{% endblock %}
{% block table %}
        <table id="t1" class="table table-striped table-bordered" cellspacing="0" width="100%">
        <thead>
            <tr>
                <th>Name</th>
                <th>Cup</th>
                <th>Bust</th>
                <th>Age</th>
                <th>height</th>
                <th>Birthday</th>
                <th>Hometown</th>
                <th>Hobby</th>
                <th>Image</th>
            </tr>
        </thead>
        <tfoot>
         <tr>
                <th>Name</th>
                <th>Cup</th>
                <th>Bust</th>
                <th>Age</th>
                <th>height</th>
                <th>Birthday</th>
                <th>Hometown</th>
                <th>Hobby</th>
                <th>Image</th>
            </tr>
        </tfoot>
      </table>
{% endblock %}
{% block script %}
   <script type="text/javascript">
       $(document).ready(function() {
	   $('#t1').dataTable( {
          "dom": '<"toolbar">rtip',
        "paging":   true,
         "pageLength": 20,
          "destroy": true,
        "ordering": true,
        "info":     true,
        "bServerSide": true,
        "bProcessing": true,
		"sAjaxSource": "{{ url_for('avbd_app.get_act_data') }}",
         "columns": [
            { "data": "actressName",
            "render": function(data, type, row) {
                    return '<a href="/actress/'+data+'">'+data+'';
                }
            },
            { "data": "cup" },
            { "data": "bust" },
            { "data": "age" },
            { "data": "height" },
            { "data": "birthday" },
            { "data": "hometown" },
            { "data": "hobby" },
            { "data":"path",
                 "render": function(data, type, row) {
                     if (data === undefined) {
                            data = "act/x.jpg";
                        }
                    return '<img src="/static/image/'+data+'" />';
                }
             }
        ],
        columnDefs: [
               { width: '15%', targets: 0 },
                { width: '5%', targets: 1},
                { width: '5%', targets: 2},
                { width: '5%', targets: 3},
                { width: '5%', targets: 4},
                { width: '15%', targets:5},
                { width: '15%', targets:6},
                { width: '15%', targets:7},
                { width: '10%', targets:8}
        ]
	});
           var data = '{{ data }}';
           $("div.toolbar").html('<b>Total actress: '+ data+'</b>');


       });
   </script>
{% endblock %}